package com.woniuxy.yygh.common.exception;

import com.woniuxy.yygh.common.result.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 全局异常处理
 * <P> Date: 2022/2/27:15:54
 * <P> Description:
 */
@ControllerAdvice
public class GlobalExceptionHandler  {


    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result Error(Exception e){
        e.printStackTrace();
        return Result.fail();
    }
}
